package cn.edu.scau.cmi.zhangweiming.abstractFactory.factory;

//import java.awt.Button;
//import java.awt.TextArea;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.text.Text;
import cn.edu.scau.cmi.zhangweiming.abstractFactory.factory.AbstractFactory;
import cn.edu.scau.cmi.zhangweiming.abstractFactory.domainAbstractClass.Meat;
import cn.edu.scau.cmi.zhangweiming.abstractFactory.domainAbstractClass.Pork;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;

public class AbstractFactory_controller {
	private AbstractFactory factory=null;
	
	@FXML
	   private Button wens,tianbang,aonong,pork,beef,chicken;
	@FXML
	   private TextArea textArea;
	@FXML
	   private Text brandText,meatText;
	
	public void Wens(ActionEvent event) {
		 factory=AbstractFactory.getFactory("Wens");
	}
	public void Tianbang(ActionEvent event) {
		factory=AbstractFactory.getFactory("Tianbang");
	}
	public void Aonong(ActionEvent event) {
		factory=AbstractFactory.getFactory("Aonong");
	}
	public void Pork(ActionEvent event) {
		Meat meat=factory.createPork();
		textArea.appendText(meat.produce());
		textArea.appendText("\n");
	}
	public void Beef(ActionEvent event) {
		Meat meat=factory.createBeef();
		textArea.appendText(meat.produce());
		textArea.appendText("\n");
	}
	public void Chicken(ActionEvent event) {
		Meat meat=factory.createChicken();
		textArea.appendText(meat.produce());
		textArea.appendText("\n");
	}
}
